<template>
  <div>
    <div v-if="no">没数据了</div>
    <div v-else>
      <header-index title="商城" :showTwo="false" />
      <template v-if="$store.state.goodsMore.goodsArr.length > 0">
        <img :src="$store.state.goodsMore.goodsArr[10].img" alt="" />
      </template>
      <ul>
        <storeMoreMain v-for="v in this.$store.getters.sliceGoodsArr" :v="v" :key="v.dealid" />
      </ul>
    </div>
  </div>
</template>

<script>
import storeMoreMain from '@/components/whs/store/storeMore-main.vue';
export default {
  components: {
    storeMoreMain,
  },
  data() {
    return {
      no: false,
    };
  },
  mounted() {
    if (this.$route.query.id == 58) {
      this.$store.dispatch('getGoodsArr', '/apidl/store/more1');
    } else if (this.$route.query.id == 56) {
      this.$store.dispatch('getGoodsArr', '/apidl/store/more2');
    } else if (this.$route.query.id == 54) {
      this.$store.dispatch('getGoodsArr', '/apidl/store/more3');
    } else {
      this.no = true;
    }
  },
};
</script>

<style lang="less" scoped>
img {
  width: 100%;
}
ul {
  padding: 0.3rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}
</style>
